<div class="row-fluid">
    <div class="span3 well well-small">
		<fieldset>
            <legend>#i18n{portal.rbac.view_role_description.titleRoleDescription}</legend>
			<p><strong>#i18n{portal.rbac.view_role_description.labelKey} :</strong> ${role.key}</p>
			<p><strong>#i18n{portal.rbac.view_role_description.labelDescription} :</strong> ${role.description}</p>
			<form class="form-horizontal" method="post"  action="jsp/admin/rbac/ModifyRole.jsp">
			<input type="hidden" name="role_key" value="${role.key}" />
			<button class="btn btn-primary btn-small" type="submit" >
				<i class="icon-edit icon-white"></i>&nbsp;#i18n{portal.rbac.view_role_description.buttonLabelModify}
			</button>
			</form>
        </fieldset>
	</div>
	<div class="span8">
			<form class="form-inline pull-right" method="post"  action="jsp/admin/rbac/AddControlToRole.jsp">
            <fieldset>
                <legend>
					<span class="pull-left">#i18n{portal.rbac.view_role_description.titleControlsList} "${role.key}" </span>
                        <select name="resource_type" >
                            <!--<option value =""></option>-->
                            <#list resource_type_list?sort_by("resourceTypeLabel") as resource_type >
                            <option value ="${resource_type.resourceTypeKey}">${resource_type.resourceTypeLabel}</option>
                            </#list>
                        </select>
                        <input type="hidden" name="role_key" value="${role.key}" />
                        <button class="btn btn-primary btn-small" type="submit" title="#i18n{portal.rbac.view_role_description.buttonLabelAddControl}">
							<i class="icon-plus icon-white"></i>
						</button>
				</legend>
				</fieldset>
    
                    </form>
                <table class="table table-striped table-condensed">
                    <tr>
                        <th>#i18n{portal.rbac.view_role_description.columnTitleResourceType}</th>
                        <th>#i18n{portal.rbac.view_role_description.columnTitleResourceId}</th>
                        <th>#i18n{portal.rbac.view_role_description.columnTitlePermission}</th>
                        <th>#i18n{portal.rbac.view_role_description.columnTitleDeleteControl}</th>
                    </tr>
                    <#assign previousResourceTypeKey = "" >
                    <#list controled_resource_list as controled_resource >
                    
                    <tr>
                        <#if controled_resource.resourceTypeKey != previousResourceTypeKey >
							<td><strong>${controled_resource.resourceTypeLabel} (${controled_resource.resourceTypeKey})</strong></td>
                        <#else>
							<td>&nbsp;</td>
                        </#if>
                        <!--<td>${controled_resource.resourceTypeLabel} (${controled_resource.resourceTypeKey})</td>-->
                        <td>${controled_resource.resourceIdLabel} (${controled_resource.resourceId})</td>
                        <td>${controled_resource.permissionLabel} (${controled_resource.permissionKey})</td>
                        <td>
                            <form class="form-inline" method="post"  action="jsp/admin/rbac/DoConfirmRemoveControlFromRole.jsp">
								<input type="hidden" name="rbac_id" value="${controled_resource.RBACId}" />
								<button class="btn btn-danger btn-small" type="submit" title="#i18n{portal.rbac.view_role_description.buttonLabelDeleteControl}">
									<i class="icon-trash icon-white"></i>
								</button>
                            </form>
                        </td>
                    </tr>
                    <#assign previousResourceTypeKey = controled_resource.resourceTypeKey >
                    </#list>
                </table>
                                  
           </div> 
</div>